﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}

@section css {
    <style>
        .IsException {
            color: red;
        }

        .IsNormal {
            color: blue;
        }

        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }
    </style>
}
<header class="mui-bar mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" href="MSafetyCostApplyList"></a>
    <h1 class="mui-title" style="color:white;">安全费用申请详细</h1>
</header>
<div class="mui-content" ng-cloak ng-controller="SafetyCostController" ng-init="
     Id='@(Request.QueryString["Id"].IsEmpty() ? "" : Request.QueryString["Id"])';
     GetSafetyBudgetApplyDetail(Id);
     GetSafetyFormFile(Id);
    GetBudgetStatusDetail(Id);
       ApproveModel.FormId=Id;
     ApproveModel.Type=2;
     ">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>部门</label>
            <input type="text" ng-model="BudgetDetail.DepartmentName" disabled />
        </div>
        <div class="mui-input-row">
            <label>申请人</label>
            <input type="text" ng-model="BudgetDetail.CreateUserName" disabled />
        </div>
        <div class="mui-input-row">
            <label>申请时间</label>
            <input type="text" value="{{BudgetDetail.ApplyDate}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>总金额</label>
            <input type="text" value="{{BudgetDetail.TotalAmount}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>状态</label>
            <input type="text" value="{{BudgetDetail.StatusName}}" disabled />
        </div>
    </form>
    <div class="title">
        申请项目：{{BudgetDetail.ApplyItems.length}}
    </div>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell" ng-repeat="a in BudgetDetail.ApplyItems">
            <p>{{a.RangeModel.Title}}.{{a.RangeModel.Content}}</p>
            <p>金额：<span style="color:red;">{{a.Amount}} {{a.Amount|TransCurrency}}</span></p>
            <p ng-show="a.Remark!=null && a.Remark!=''">备注：{{a.Remark}}</p>
        </li>
    </ul>
    <div class="title">
        附件：{{FileList.length}}
    </div>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell" ng-repeat="f in FileList"><a style="display:block;" ng-href="../Download/DownloadFile?FileId={{f.FileId}}">{{f.FileName}}</a></li>
    </ul>

    <div class="title">
        {{BudgetStatusDetail.StatusInfo.OperateName}}
    </div>
    <form class="mui-input-group" ng-init="ApproveModel.ApproveTime='@DateTime.Now.ToString("yyyy-MM-dd HH:mm")';ApproveModel.Id=FormId;">
        <div class="mui-input-row">
            <label>审核人</label>
            <input type="text" placeholder="地点/部位" value="{{User.UserName}}" disabled />
        </div>
        <div class="mui-input-row">
            <label>审核时间</label>
            <input type="text" value="@DateTime.Now.ToString("MM-dd HH:mm")" disabled />
        </div>
        <div class="mui-input-row">
            <label>下一节点</label>
            <select ng-if="BudgetStatusDetail.FlowInfo.CompleteStatus!=null" ng-model="ApproveModel.IsComplete">
                <option selected value="">请选择</option>
                <option value="true">审核流程结束</option>
                <option value="false">{{BudgetStatusDetail.NextStatus.OperateName}}</option>
            </select>
            <input ng-if="BudgetStatusDetail.FlowInfo.CompleteStatus==null" type="text" readonly value="{{BudgetStatusDetail.NextStatus.OperateName}}" />
        </div>
        <div class="mui-input-row" ng-show="BudgetStatusDetail.FlowInfo.CompleteStatus!=null && ApproveModel.IsComplete=='false'" style="overflow:visible;">
            <label>下级审核人</label>
            <input type="text" ng-model="name" ng-change="GetUserByName(name);" />
        </div>
        <div class="result_items" ng-show="resultlist!=null && resultlist.length>0">
            <div class="result_user" ng-repeat="x in resultlist" ng-click="selectuser(x);">{{x.UserNo}}-{{x.UserName}}</div>
        </div>
    </form>



    <h5>
        &nbsp;&nbsp;&nbsp;&nbsp;审核意见
    </h5>

    <textarea id="textarea" rows="5" ng-model="ApproveModel.Remark"></textarea>
    <div class="mui-button-row" style="margin-top:50px;">
        <button type="button" ng-click="MBudgetApprove(ApproveModel,true,'MSafetyCostApplyList');" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">同 &nbsp;&nbsp;意</button>
        <button type="button" ng-click="MBudgetApprove(ApproveModel,false,'MSafetyCostApplyList');" ng-disabled="Loading" class="mui-btn mui-btn-success mui-btn-block">驳 &nbsp;&nbsp;回</button>
    </div>
    <div style="height:100px;"></div>
</div>
@section js{
    <script src="~/Assets/js/pg/SafetyCost.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>

    <script>
        mui.init({
            swipeBack: false,
            keyEventBind: {
                backbutton: false  //关闭back按键监听
            }
        });
    </script>
}
